package com.itheima.原子性.Demo1;

public class Demo {
    public static void main(String[] args) {
        MyAtomThread atom = new MyAtomThread();

        for (int i = 0; i < 1000; i++) {
            new Thread(atom).start();
        }
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("已经送出的第"+atom.getCount() + "个冰淇淋");
    }
}
